﻿using System;
using CxRomos.Web.Account.Interface;
using CxRomos.Web.Account.Presenter;

namespace CxRomos.Web.Account {
    public partial class Login : System.Web.UI.Page, ILogin {
        private LoginPresenter _presenter;
        protected void Page_Load(object sender, EventArgs e) {
            _presenter = new LoginPresenter();
            _presenter.Init(this);
        }

        protected void btnLogin_Click(object sender, EventArgs e) {
            _presenter.Login(txtUsername.Text, txtPassword.Text);
        }

        protected void lbRecoverPassword_Click(object sender, EventArgs e) {
            _presenter.GoToRecoveryPassword();
        }

        protected void lbRegister_Click(object sender, EventArgs e) {
            _presenter.GoToRegister();
        }

        public void DisplayMessage(string message) {
            lblMessage.Text = message;
        }
    }
}
